<template>
  <view class="protocols-wrapper">
    <image
      class="my-bg"
      src="https://ai-sbbs.xyz/api/profile/upload/2024/07/01/216ecf4ef90549a1b0d6b8cd648786f9.png"
      mode="scaleToFill"
    />
    <view class="desc" v-html="dataInfo"></view>
  </view>
</template>

<script>
import { protocolsGetProtocolsApi } from "@/apis/qiuqian";

export default {
  data() {
    return {
      type: "",
      dataInfo: "",
      textList: {
        "02": "隐私政策",
        "03": "使用协议",
        "04": "系统信息",
        "05": "关于我们"
      }
    };
  },
  onLoad(opt) {
    this.type = opt.type;

    uni.setNavigationBarTitle({
      title: this.textList[opt.type]
    });

    this.initData();
  },
  methods: {
    async initData() {
      let { code, data } = await protocolsGetProtocolsApi({
        type: this.type
      });
      if (code == 1) {
        this.dataInfo = data.protoclContent;
      }
    }
  }
};
</script>

<style lang="scss">
.protocols-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #f5f6f7;
  position: relative;
  padding: 12px;
  .my-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
  }
  .desc {
  }
}
</style>